# coding: utf-8
from qfluentwidgets import FluentIcon
from qfluentwidgets.multimedia import MediaPlayBarButton
from qtpy.QtCore import QSize


class FullScreenButton(MediaPlayBarButton):
    """ Full screen button """

    def _postInit(self):
        super()._postInit()
        self.setIconSize(QSize(14, 14))
        self.setFullScreen(False)

    def setFullScreen(self, isFull: bool):
        if isFull:
            self.setIcon(FluentIcon.BACK_TO_WINDOW)
            self.setToolTip(self.tr('退出全屏'))
        else:
            self.setIcon(FluentIcon.FULL_SCREEN)
            self.setToolTip(self.tr('全屏'))
